package chapter23;

import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/27 16:11
 */
@Aspect({ClassA.class, ClassB.class})
public class ServiceLogAspect {
    public static void before(Object object, Method method, Object[] args) {
        System.out.println("entering " + method.getDeclaringClass().getSimpleName() + ":" + method.getName() + ",args: " + Arrays.toString(args));
    }

    public static void after(Object object, Method method, Object[] args, Object result) {
        System.out.println("leaving " + method.getDeclaringClass().getSimpleName() + ":" + method.getName() + ", result: " + result);
    }
}
